#ifndef ROOM_RECORD_COMMAND_IN_H_
#define ROOM_RECORD_COMMAND_IN_H_
#include "command.h"

#pragma pack(1)
namespace Cmd
{
        namespace RoomRecord
        {
                //  cmd declaration
                enum {
                        CMDIN_LOGIN             = 0x0010,       // 登录RoomRecordServer验证指令
                        CMDIN_FORWARD           = 0x0011,	// 转发的指令
                        CMDIN_ROOM              = 0x0012,	// 与RoomServer交互的指令
                        CMDIN_SESSION           = 0x0013,
                        CMDIN_ROOMFLOWER        = 0x0014,
                };
                enum { //CMDIN_LOGIN
                        SCMDIN_LOGIN                            = 0x0001,       // 请求登录RoomRecordServer
                        SCMDIN_LOGIN_RESPONCE                   = 0x0002,	// 登录RoomRecordServer返回
                };
                enum { //CMDIN_ROOM
                        SCMDIN_ROOM_RES_ROOM_INFO               = 0x0002,
                        SCMDIN_ROOM_REQ_MEMBER_LIST_old         = 0x0003,
                        SCMDIN_ROOM_RES_MEMBER_LIST_old         = 0x0004,
                        SCMDIN_ROOM_RELOAD_ROOM_FOR_CRUSH_REQ_old       = 0x0005,       // Room->Record:请求为宕机恢复频道重加载
                        SCMDIN_ROOM_RELOAD_ROOM_FOR_CRUSH_RES   = 0x0006,       // Record->Room:返回宕机频道重加载的结果
                        SCMDIN_ROOM_BLACK_LIST_ADD              = 0x0007,       // room->record:请求增加黑名单列表
                        SCMDIN_ROOM_BLACK_LIST_REQ              = 0x0008,       // room->record:请求房间的黑名单列表
                        SCMDIN_ROOM_BLACK_LIST_RES              = 0x0009,       // record->room:返回房间的黑名单列表
                        SCMDIN_ROOM_RELOAD_FOR_DEPLOY_REQ       = 0x000A,       // Room->Record:请求为调度恢复频道重加载
                        SCMDIN_ROOM_RELOAD_FOR_DEPLOY_RES       = 0x000B,       // Record->Room:返回调度频道重加载的结果
                        SCMDIN_ROOM_USER_ENTER_LOG              = 0x000C,       // Room->Record:用户进入房间记录
                        SCMDIN_ROOM_USER_LEAVE_LOG              = 0x000D,       // Record->Room:用户退出房间记录
                        SCMDIN_ROOM_NOTIFY_BLACK_ID             = 0x000E,
                        SCMDIN_ROOM_NOTIFY_BLACK_IP             = 0x000F,
                        SCMDIN_ROOM_NOTIFY_RELEASE_BLACK_ID     = 0x0010,
                        SCMDIN_ROOM_NOTIFY_RELEASE_BLACK_IP     = 0x0011,
                        SCMDIN_ROOM_CHK_NEW_INFO_REQ            = 0x0012,
                        SCMDIN_ROOM_CHK_NEW_INFO_RES            = 0x0013,
                        SCMDIN_ROOM_VIDEO_PARAMETER_REQ         = 0x0014,
                        SCMDIN_ROOM_VIDEO_PARAMETER_RES         = 0x0015,
                        SCMDIN_ROOM_DESKTOP_PARAMETER_REQ       = 0x0016,
                        SCMDIN_ROOM_DESKTOP_PARAMETER_RES       = 0x0017,
                        SCMDIN_ROOM_SYNC_USER_NET_LIST          = 0x0018,
                        SCMDIN_ROOM_REQ_ROOM_INFO               = 0x0019,       // Room->Record:请求房间基本信息
                        SCMDIN_ROOM_REQ_MEMBER_LIST             = 0x001A,
                        SCMDIN_ROOM_RES_MEMBER_LIST             = 0x001B,
                        SCMDIN_ROOM_RELOAD_ROOM_FOR_CRUSH_REQ   = 0x001C,       // Room->Record:请求为宕机恢复频道重加载
                        SCMDIN_ROOM_NOTIFY_RELEASE_ROOM_BLACK_ID = 0x001D,      // Record->Room: 通知释放房间黑名单用户.
                };
                enum { //CMDIN_ROOMFLOWER
                        SCMDIN_ROOMFLOWER_USER_OWN_FLOWER_REQ   = 0x0001,
                        SCMDIN_ROOMFLOWER_USER_OWN_FLOWER_RES   = 0x0002,
                        SCMDIN_ROOMFLOWER_USER_OWN_FLOWER_IN_REQ        = 0x0003,
                        SCMDIN_ROOMFLOWER_USER_OWN_FLOWER_IN_RES        = 0x0004,
                        SCMDIN_ROOMFLOWER_SET_USER_OWN_FLOWER   = 0x0005,
                };

                //	cmd definition
                struct stLoginCmd:t_NullCmd
                {
                        stLoginCmd():
                                t_NullCmd(CMDIN_LOGIN, SCMDIN_LOGIN)
                        {
                                dest_type_ = ROOMRECORDSERVER;
                                server_type_ = 0;
                                server_id_ = 0;
                        }
                        WORD dest_type_;
                        WORD server_type_;
                        DWORD server_id_;
                };
                struct stLoginResponce:t_NullCmd
                {
                        stLoginResponce():
                                t_NullCmd(CMDIN_LOGIN, SCMDIN_LOGIN_RESPONCE)
                        {
                        }
                };

                struct stRoomReqRoomInfo:
                        t_NullCmd
                {
                        stRoomReqRoomInfo():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_REQ_ROOM_INFO)
                        {
                                room_id_ = 0;
                        }

                        uint32_t room_id_;
                };
                struct stRoomResRoomInfo:
                        t_NullCmd
                {
                        stRoomResRoomInfo():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_RES_ROOM_INFO)
                        {
                                room_id_= 0;
                                bzero(room_name_, sizeof(room_name_));
                                room_type_ = eRoomType_Public;
                                app_bit_mask_ = eRoomAppBitMask_WhiteBoard;
                                user_limit_ = 0;
                                allow_unactivated_user = 1;
                        }
                        DWORD room_id_;
                        char room_name_[MAX_ROOM_NAME_SIZE+1];
                        BYTE room_type_;                //eRoomType
                        DWORD app_bit_mask_;            //eRoomAppBitMask_WhiteBoard
                        uint32_t user_limit_;
                        uint8_t allow_unactivated_user; //是否允许未激活用户输出内容 0-不允许 1-允许
                };
                struct stRoomReqMemberList_old:
                        t_NullCmd
                {
                        stRoomReqMemberList_old():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_REQ_MEMBER_LIST_old)
                        {
                                room_id_ = 0;
                        }
                        DWORD room_id_;
                };
                struct stRoomReqMemberList:
                        t_NullCmd
                {
                        stRoomReqMemberList():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_REQ_MEMBER_LIST)
                        {
                                room_id_ = 0;
                        }

                        uint32_t room_id_;
                };
                struct stRoomResMemberList_old:
                        t_NullCmd
                {
                        stRoomResMemberList_old():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_RES_MEMBER_LIST_old)
                        {
                                room_id_ = 0;
                                size_ = 0;
                        }
                        DWORD room_id_;
                        WORD size_;
                        struct {
                                DWORD userid;
                                BYTE power;
                        } list_[0];
                        DWORD getSize()
                        {
                                return sizeof(*this)+size_*sizeof(list_[0]);
                        }
                };
                struct stRoomResMemberList:
                        t_NullCmd
                {
                        stRoomResMemberList():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_RES_MEMBER_LIST)
                        {
                                room_id_ = 0;
                                size_ = 0;
                        }

                        uint32_t getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(list_[0]);
                        }

                        uint32_t room_id_;
                        uint32_t size_;
                        struct {
                                uint32_t userid;
                                uint8_t power;
                                uint32_t appbitmask;
                        } list_[0];
                };
                struct stRoomReloadRoomForCrushReq_old:
                        t_NullCmd
                {
                        stRoomReloadRoomForCrushReq_old():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_RELOAD_ROOM_FOR_CRUSH_REQ_old)
                        {
                                room_id_ = 0;
                        }
                        DWORD room_id_;
                };
                struct stRoomReloadRoomForCrushReq:
                        t_NullCmd
                {
                        stRoomReloadRoomForCrushReq():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_RELOAD_ROOM_FOR_CRUSH_REQ)
                        {
                                room_id_ = 0;
                        }

                        uint32_t room_id_;
                };
                struct stRoomReloadRoomForCrushRes:
                        t_NullCmd
                {
                        stRoomReloadRoomForCrushRes():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_RELOAD_ROOM_FOR_CRUSH_RES)
                        {
                                room_id_ = 0;
                                bzero(room_name_, sizeof(room_name_));
                                ret_code_= 0;
                                app_bit_mask_ = eRoomAppBitMask_WhiteBoard;
                                user_limit_ = 0;
                                allow_unactivated_user = 1;
                        }
                        DWORD room_id_;
                        char room_name_[MAX_ROOM_NAME_SIZE+1];
                        BYTE room_type_;
                        BYTE ret_code_; //0-fail 1-success
                        DWORD app_bit_mask_;    // eRoomAppBitMask_WhiteBoard
                        uint32_t user_limit_;
                        uint8_t allow_unactivated_user;
                };
                struct stRoomBlackListAdd:
                        t_NullCmd
                {
                        stRoomBlackListAdd():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_BLACK_LIST_ADD)
                        {
                                room_id_ = 0;
                                user_id_ = 0;
                                manager_ = 0;
                                release_time_ = 0;
                                bzero(reason_, sizeof(reason_));
                        }
                        DWORD room_id_;
                        DWORD user_id_;
                        DWORD manager_;
                        DWORD release_time_;
                        char reason_[MAX_ADD_ROOM_BLACK_REASON+1];
                };
                struct stRoomBlackListReq:
                        t_NullCmd
                {
                        stRoomBlackListReq():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_BLACK_LIST_REQ)
                        {
                                room_id_ = 0;
                        }
                        DWORD room_id_;
                };
                struct stRoomBlackListRes:
                        t_NullCmd
                {
                        stRoomBlackListRes():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_BLACK_LIST_RES)
                        {
                                room_id_ = 0;
                        }
                        DWORD room_id_;
                        DWORD num_;
                        struct {
                                DWORD userid;
                                DWORD releasetime;
                        }list_[0];
                        DWORD getSize() {
                                return sizeof(*this)+num_*sizeof(list_[0]);
                        }
                };
                struct stRoomReloadForDeployReq:
                        t_NullCmd
                {
                        stRoomReloadForDeployReq():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_RELOAD_FOR_DEPLOY_REQ)
                        {
                                room_id_ = 0;
                        }
                        DWORD room_id_;
                };
                struct stRoomReloadForDeployRes:
                        t_NullCmd
                {
                        stRoomReloadForDeployRes():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_RELOAD_FOR_DEPLOY_RES)
                        {
                                room_id_ = 0;
                                bzero(room_name_, sizeof(room_name_));
                                ret_code_= 0;
                                app_bit_mask_ = eRoomAppBitMask_WhiteBoard;
                                user_limit_ = 0; 
                                allow_unactivated_user = 1;
                        }
                        DWORD room_id_;
                        char room_name_[MAX_ROOM_NAME_SIZE+1];
                        BYTE room_type_;
                        BYTE ret_code_; //0-fail 1-success
                        DWORD app_bit_mask_;    // eRoomAppBitMask_WhiteBoard
                        uint32_t user_limit_;
                        uint8_t allow_unactivated_user;
                };
                struct stRoomUserEnterLog:
                        t_NullCmd
                {
                        stRoomUserEnterLog():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_USER_ENTER_LOG)
                        {
                                room_id_ = 0;
                                user_id_ = 0;
                                time_ = 0;
                                bzero(user_name_, sizeof(user_name_));
                        }
                        DWORD room_id_;
                        DWORD user_id_;
                        DWORD time_;
                        char user_name_[MAX_ACCOUNT_SIZE+1];
                        char unique_id_[128];
                };
                struct stRoomUserLeaveLog:
                        t_NullCmd
                {
                        stRoomUserLeaveLog():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_USER_LEAVE_LOG)
                        {
                                room_id_ = 0;
                                user_id_ = 0;
                                time_ = 0;
                                bzero(user_name_, sizeof(user_name_));
                        }
                        DWORD room_id_;
                        DWORD user_id_;
                        DWORD time_;
                        char user_name_[MAX_ACCOUNT_SIZE+1];
                        uint32_t duration_;
                        char unique_id_[128];
                };
                struct stRoomNotifyBlackID:
                        t_NullCmd
                {
                        stRoomNotifyBlackID():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_NOTIFY_BLACK_ID)
                        {
                                num_ = 0;
                        }
                        WORD num_;
                        struct {
                                DWORD userid;
                                DWORD releasetime;
                                char reason[256];
                        } list_[0];
                        DWORD getSize() {
                                return sizeof(*this) + num_*sizeof(list_[0]);
                        }
                };
                struct stRoomNotifyBlackIP:
                        t_NullCmd
                {
                        stRoomNotifyBlackIP():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_NOTIFY_BLACK_IP)
                        {
                                num_ = 0;
                        }
                        WORD num_;
                        struct {
                                DWORD ip;
                                DWORD releasetime;
                                char reason[256];
                        } list_[0];
                        DWORD getSize() {
                                return sizeof(*this) + num_*sizeof(list_[0]);
                        }
                };
                struct stRoomNotifyReleaseBlackID:
                        t_NullCmd
                {
                        stRoomNotifyReleaseBlackID():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_NOTIFY_RELEASE_BLACK_ID)
                        {
                                num_ = 0;
                        }
                        WORD num_;
                        DWORD id_list_[0];
                        DWORD getSize() {
                                return sizeof(*this) + num_*sizeof(id_list_[0]);
                        }
                };
                struct stRoomNotifyReleaseBlackIP:
                        t_NullCmd
                {
                        stRoomNotifyReleaseBlackIP():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_NOTIFY_RELEASE_BLACK_IP)
                        {
                                num_ = 0;
                        }
                        WORD num_;
                        DWORD ip_list_[0];
                        DWORD getSize() {
                                return sizeof(*this) + num_*sizeof(ip_list_[0]);
                        }
                };
                struct stRoomChkNewInfoReq:
                        t_NullCmd
                {
                        stRoomChkNewInfoReq():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_CHK_NEW_INFO_REQ)
                        {
                                num_ = 0;
                        }
                        WORD num_;
                        DWORD list_[0];
                        DWORD getSize()
                        {
                                return sizeof(*this)+num_*sizeof(list_[0]);
                        }
                };
                struct stRoomChkNewInfoRes:
                        t_NullCmd
                {
                        stRoomChkNewInfoRes():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_CHK_NEW_INFO_RES)
                        {
                                room_id_ = 0;
                                bzero(room_name_, sizeof(room_name_));
                                room_type_ = eRoomType_Public;
                                app_bit_mask_ = eRoomAppBitMask_WhiteBoard;
                                user_limit_ = 0;
                                allow_unactivated_user = 1;
                        }
                        DWORD room_id_;
                        char room_name_[MAX_ROOM_NAME_SIZE+1];
                        BYTE room_type_;        // eRoomType
                        DWORD app_bit_mask_;    // eRoomAppBitMask_WhiteBoard
                        uint32_t user_limit_;
                        uint8_t allow_unactivated_user;
                };
                struct stRoomVideoParameterReq:
                        t_NullCmd
                {
                        stRoomVideoParameterReq():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_VIDEO_PARAMETER_REQ)
                        {
                                room_id_ = 0;
                        }

                        DWORD room_id_;
                };
                struct stRoomVideoParameterRes:
                        t_NullCmd
                {
                        stRoomVideoParameterRes():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_VIDEO_PARAMETER_RES)
                        {
                                room_id_ = 0;
                                resolution_x_ = 0;
                                resolution_y_ = 0;
                                frame_rate_ = 0;
                                bit_rate_ = 0;
                                codec_index_ = 0;
                        }

                        DWORD room_id_;
                        WORD resolution_x_;
                        WORD resolution_y_;
                        WORD frame_rate_;
                        DWORD bit_rate_;
                        WORD codec_index_;
                };
                struct stRoomDesktopParameterReq:
                        t_NullCmd
                {
                        stRoomDesktopParameterReq():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_DESKTOP_PARAMETER_REQ)
                        {
                                room_id_ = 0;
                        }

                        DWORD room_id_;
                };
                struct stRoomDesktopParameterRes:
                        t_NullCmd
                {
                        stRoomDesktopParameterRes():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_DESKTOP_PARAMETER_RES)
                        {
                                room_id_ = 0;
                                resolution_x_ = 0;
                                resolution_y_ = 0;
                                frame_rate_ = 0;
                                bit_rate_ = 0;
                        }

                        DWORD room_id_;
                        WORD resolution_x_;
                        WORD resolution_y_;
                        WORD frame_rate_;
                        DWORD bit_rate_;
                        WORD codec_index_;
                };
                struct stRoomSyncUserNetList:
                        t_NullCmd
                {
                        stRoomSyncUserNetList():
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_SYNC_USER_NET_LIST)
                        {
                                size_ = 0;
                        }

                        DWORD getSize() const
                        {
                                return sizeof(*this) + size_ * sizeof(list_[0]);
                        }

                        WORD size_;
                        struct stUserNet {
                                DWORD user_id_;
                                WORD net_;
                        } list_[0];
                };

                struct stRoomFlowerUserOwnFlowerReq:
                        t_NullCmd
                {
                        stRoomFlowerUserOwnFlowerReq():
                                t_NullCmd(CMDIN_ROOMFLOWER, SCMDIN_ROOMFLOWER_USER_OWN_FLOWER_REQ)
                        {
                                user_id_ = 0;
                                room_id_ = 0;
                                requester_id_ = 0;
                                task_id_ = 0;
                                size_ = 0;
                        }

                        DWORD getSize() const
                        {
                                return sizeof(*this) + size_ * sizeof(data_[0]);
                        }

                        DWORD user_id_;

                        DWORD room_id_;
                        DWORD requester_id_;
                        WORD task_id_;
                        WORD size_;
                        BYTE data_[0];
                };
                struct stRoomFlowerUserOwnFlowerRes:
                        t_NullCmd
                {
                        stRoomFlowerUserOwnFlowerRes():
                                t_NullCmd(CMDIN_ROOMFLOWER, SCMDIN_ROOMFLOWER_USER_OWN_FLOWER_RES)
                        {
                                user_id_ = 0;
                                room_id_ = 0;
                                requester_id_ = 0;
                                task_id_ = 0;
                                ret_code_ = 0;
                                own_flower_ = 0;
                                size_ = 0;
                        }

                        DWORD getSize() const
                        {
                                return sizeof(*this) + size_ * sizeof(data_[0]);
                        }

                        DWORD user_id_;
                        BYTE ret_code_;
                        DWORD own_flower_;

                        DWORD room_id_;
                        DWORD requester_id_;
                        WORD task_id_;
                        WORD size_;
                        BYTE data_[0];
                };
                struct stRoomFlowerUserOwnFlowerInReq:
                        t_NullCmd
                {
                        stRoomFlowerUserOwnFlowerInReq():
                                t_NullCmd(CMDIN_ROOMFLOWER, SCMDIN_ROOMFLOWER_USER_OWN_FLOWER_IN_REQ)
                        {
                                user_id_ = 0;
                                task_id_ = 0;
                                size_ = 0;
                        }

                        DWORD getSize() const
                        {
                                return sizeof(*this) + size_ * sizeof(data_[0]);
                        }

                        DWORD user_id_;

                        WORD task_id_;
                        WORD size_;
                        BYTE data_[0];
                };
                struct stRoomFlowerUserOwnFlowerInRes:
                        t_NullCmd
                {
                        stRoomFlowerUserOwnFlowerInRes():
                                t_NullCmd(CMDIN_ROOMFLOWER, SCMDIN_ROOMFLOWER_USER_OWN_FLOWER_IN_RES)
                        {
                                user_id_ = 0;
                                task_id_ = 0;
                                ret_code_ = 0;
                                own_flower_ = 0;
                                size_ = 0;
                        }

                        DWORD getSize() const
                        {
                                return sizeof(*this) + size_ * sizeof(data_[0]);
                        }

                        DWORD user_id_;
                        BYTE ret_code_;
                        DWORD own_flower_;

                        WORD task_id_;
                        WORD size_;
                        BYTE data_[0];
                };
                struct stRoomFlowerSetUserOwnFlower:
                        t_NullCmd
                {
                        stRoomFlowerSetUserOwnFlower():
                                t_NullCmd(CMDIN_ROOMFLOWER, SCMDIN_ROOMFLOWER_SET_USER_OWN_FLOWER)
                        {
                                user_id_ = 0;
                                own_flower_ = 0;
                        }

                        DWORD user_id_;
                        DWORD own_flower_;
                };

                struct stRoomNotifyRoomReleaseBlackID :
                        t_NullCmd
                {
                        stRoomNotifyRoomReleaseBlackID() :
                                t_NullCmd(CMDIN_ROOM, SCMDIN_ROOM_NOTIFY_RELEASE_ROOM_BLACK_ID)
                        {
                                num_ = 0;
                        }
                        WORD num_;
                        struct {
                                uint32_t user_id;
                                uint32_t release_time;
                                uint32_t room_id;
                        } list_[0];
                        DWORD getSize() {
                                return sizeof(*this) + num_*sizeof(list_[0]);
                        }
                };
        }; //namespace RoomRecord
}; //namespace Cmd
#pragma pack() //pack(1)

#endif //ROOM_RECORD_COMMAND_H_
